﻿namespace LeadMaster.Controllers
{
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.Entity;
    using System.Linq;
    using System.Web;
    using System.Web.Mvc;
    using LeadMaster.Models;
    using LeadMaster.DAL;
    using LeadMaster.Helpers;
    using System.IO;

    public class FunctionsController : Controller
    {

        private DunsmoreContext db = new DunsmoreContext();

        public ActionResult CompanyLogos()
        {
            Maintenance.inMaintenance = true;
            return View();
        }

        [HttpPost]
        public ActionResult UploadCompanyLogo(HttpPostedFileBase file)
        {

            if (file.ContentLength > 0)
            {
                var fileName = Path.GetFileName(file.FileName);
                var path = Path.Combine(Server.MapPath("~/ClientImages"), fileName);
                file.SaveAs(path);
            }

            return RedirectToAction("Index", "Home");
        }

        public void ResetLockouts()
        {
          GenericRepository gr = new GenericRepository();
          bool poChanged = gr.ResetLockout();
        }

    }
}
